package com.gopay.common.report.dao.impl;

import java.util.List;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.domain.report.ReportConsoleTransQuery;
import com.gopay.common.report.dao.ReportConsoleTransQueryDAO;

/**
 * @ReportConsoleTransQueryDAOImpl.java
 * @author fanghw
 * @2015年6月12日 下午4:45:33 www.gopay.com.cn Inc.All rights reserved.
 */
public class ReportConsoleTransQueryDAOImpl extends BaseDAOImpl<ReportConsoleTransQuery, String> implements
        ReportConsoleTransQueryDAO {
    @Override
    public List<Object> findInitialOrderBySql(String ymd) {
        ymd=ymd.trim();
        String sql = "select distinct r.gopay_order_id from report_console_trans_query r ";
        sql += "left join mq_event_info m ";
        sql += "on r.gopay_order_id = m.gopay_order_id ";
        sql += "where m.stat != '01' ";
        sql += "and 3000 <= r.txn_sta_cd and 4000 > r.txn_sta_cd ";
        sql += "and r.gopay_order_id like '"+ymd+"%'";
        
       List<?> list = this.findBySql(sql);
       return (List<Object>) list;
    }

    @Override
    public List<Object> findLackOrderBySql(String ymd) {
        String newQueryGopayOrderIdSql = "select r.gopay_order_id from report_console_trans_query r where r.gopay_order_id like '"
                + ymd + "%'";
        List<?> list = this.findBySql(newQueryGopayOrderIdSql);
        return (List<Object>) list;
    }
}
